var http = require("http"),
	url = require("url"),
	_route = null,
	_handle = null;

function sleep(milliSeconds) {  
	var startTime = new Date().getTime();  
	while (new Date().getTime() < startTime + milliSeconds);  
} 

function onRequest(req,res){
	sleep(100000);
	var pathname = url.parse(req.url).pathname;
	var content = _route(_handle, pathname, res);
}

function start(route, handle){
	_route = route;
	_handle = handle;
	http.createServer(onRequest).listen(8888);
}

exports.start = start;